<?php
/*
 *	RATE PLUGIN
 *	@package rate
 *	@author Miguel Montes mmontesp@gmail.com
 *	@license GNU General Public License (GPL) version 2
 *	@copyright (c) Miguel Montes 2008
 *	@link http://community.elgg.org/pg/profile/mmontesp
 */
	$opt = array(elgg_echo("rate:0")=>1, elgg_echo("rate:1")=>2, elgg_echo("rate:2")=>3, elgg_echo("rate:3")=>4, elgg_echo("rate:4")=>5, elgg_echo("rate:5")=>6);
	
	$rate = $vars['entity']->getAnnotationsAvg('generic_rate');
	$image = round($rate*2);
	$rate = $image/2;
	$alt = array_keys($opt);
	$alt = $alt[$rate];
	
	echo list_annotations($vars['entity']->getGUID(),'generic_ratecomment',10,false);
	echo "<div id=\"rate\"><img src='{$CONFIG->wwwroot}mod/validation_peda/graphics/$image.gif' alt='$alt' title='$alt'/> (".$vars['entity']->countAnnotations('generic_rate')." ".elgg_echo("rate:rates").")</div>";
	

?>